home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
FM Towns: Free Software Collection 4
/
FM Towns Free Software Collection 4 - Disc 1.iso
/
t_os
/
tmdsp
/
environ.h
< prev
next >
Wrap
C/C++ Source or Header
|
1991-10-18
|
1KB
|
37 lines
/*
環境変数領域操作関数(LsiC/HighC用) by Y.Kurihara (Nifty PDC01620)
*/
#if defined( __HIGHC__ )
#define Fchar _far unsigned char
#define Fint _far unsigned short
#define FARPTR(seg,off) ( fp_dos+(unsigned)(seg)*16+(unsigned)(off) )
extern Fchar *fp_dos;
extern Fchar *fp_psp;
#endif
#if defined( LSI_C )
#define Fchar unsigned char far
#define Fint unsigned int far
#define FARPTR(seg,off) \
( (Fchar *)((unsigned long)(seg)*0x10000+(unsigned)(off)) )
#endif
#define PSP_parent(psp) ( *(Fint *)FARPTR((psp),0x16) )
#define PSP_environ(psp) ( *(Fint *)FARPTR((psp),0x2c) )
#define MCB_mark(seg) ( *(Fchar*)FARPTR((seg-1),0x00) )
#define MCB_owner(seg) ( *(Fint *)FARPTR((seg-1),0x01) )
#define MCB_size(seg) ( *(Fint *)FARPTR((seg-1),0x03) )
#define MCB_next(seg) ( (unsigned)(seg)+MCB_size(seg)+1 )
int getpid( void ); /* プロセスIDを得る */
int getrpid( void ); /* rootのPSPを得る */
int getppid( void ); /* 親のPSPを得る */
int getcpid( void ); /* shellのPSPを得る */
int pspenv( int psp ); /* 環境変数領域を得る */
int envdel( char *var,int env ); /* 環境変数の削除 */
int envset( char *var,char *val,int env ); /* 環境変数の変更 */
char *envget( char *var,int env ); /* 環境変数の値を得る */
char *envpath( int env ); /* 環境からパス名を得る */